home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / term / extras / source / term-source.lha / termARexxGlobal.h < prev    next >
C/C++ Source or Header  |  1995-02-07  |  7KB  |  224 lines

  1. /*
  2. **    termARexxGlobal.h
  3. **
  4. **    Global data definitions for ARexx interface
  5. **
  6. **    Copyright © 1990-1995 by Olaf `Olsen' Barthel
  7. **        All Rights Reserved
  8. */
  9.  
  10. #include "termGlobal.h"
  11.  
  12.     /* Information table entry types. */
  13.  
  14. enum    {    INFO_STEM,INFO_TEXT,INFO_NUMERIC,INFO_BOOLEAN,INFO_MAPPED };
  15.  
  16.     /* Data types to save or open. */
  17.  
  18. enum    {    DATATYPE_TRANSLATIONS,DATATYPE_FUNCTIONKEYS,DATATYPE_CURSORKEYS,
  19.         DATATYPE_FASTMACROS,DATATYPE_HOTKEYS,DATATYPE_SPEECH,DATATYPE_SOUND,DATATYPE_BUFFER,
  20.         DATATYPE_CONFIGURATION,DATATYPE_PHONEBOOK,DATATYPE_SCREENTEXT,
  21.         DATATYPE_SCREENIMAGE,DATATYPE_COUNT };
  22.  
  23.     /* Requester types. */
  24.  
  25. enum    {    REQUESTER_SERIAL,REQUESTER_MODEM,REQUESTER_SCREEN,
  26.         REQUESTER_TERMINAL,REQUESTER_EMULATION,REQUESTER_CLIPBOARD,
  27.         REQUESTER_CAPTURE,REQUESTER_COMMANDS,REQUESTER_MISC,
  28.         REQUESTER_PATH,REQUESTER_TRANSFER,REQUESTER_TRANSLATIONS,
  29.         REQUESTER_FUNCTIONKEYS,REQUESTER_CURSORKEYS,REQUESTER_FASTMACROS,
  30.         REQUESTER_HOTKEYS,REQUESTER_SPEECH,REQUESTER_SOUND,REQUESTER_PHONE,
  31.         REQUESTER_COUNT };
  32.  
  33.     /* Window types. */
  34.  
  35. enum    {    WINDOWID_BUFFER,WINDOWID_REVIEW,WINDOWID_PACKET,WINDOWID_FASTMACROS,
  36.         WINDOWID_STATUS,WINDOWID_MAIN,WINDOWID_UPLOAD_QUEUE,WINDOWID_COUNT };
  37.  
  38.     /* The maximum length of an ARexx result variable. */
  39.  
  40. #define MAX_RESULT_LEN    65536
  41.  
  42.     /* ARexx interface error codes. */
  43.  
  44. #define TERMERROR_NO_DATA_TO_PROCESS            1000
  45. #define TERMERROR_INDEX_OUT_OF_RANGE            1001
  46. #define TERMERROR_UNKNOWN_OBJECT            1002
  47. #define TERMERROR_RESULT_VARIABLE_REQUIRED        1003
  48. #define TERMERROR_UNIT_NOT_AVAILABLE            1004
  49. #define TERMERROR_DEVICE_DRIVER_STILL_OPEN        1005
  50. #define TERMERROR_CLIPBOARD_ERROR            1006
  51. #define TERMERROR_INFORMATION_IS_READ_ONLY        1007
  52. #define TERMERROR_DATA_TYPES_INCOMPATIBLE        1008
  53. #define TERMERROR_LIST_IS_ALREADY_EMPTY            1009
  54. #define TERMERROR_UNKNOWN_LIST                1010
  55. #define TERMERROR_WRONG_LIST                1011
  56. #define TERMERROR_UNKNOWN_COMMAND            1012
  57.  
  58.     /* An information table entry node. */
  59.  
  60. struct AttributeEntry
  61. {
  62.     WORD     Level;        /* Node level */
  63.     STRPTR     Name;        /* Name or NULL for numeric value */
  64.     UBYTE     Type;        /* Node type (INFO_TEXT through INFO_MAPPED) */
  65.     BYTE     ReadOnly;    /* If information happens to be read-only */
  66.     STRPTR    *Mappings;    /* Type mappings if applicable */
  67.     WORD     NodeID;    /* Node ID code */
  68. };
  69.  
  70.     /* Argument mutual exclusion information. */
  71.  
  72. struct ExclusionInfo
  73. {
  74.     BYTE    A,B;
  75. };
  76.  
  77.     /* A special message and argument packet. */
  78.  
  79. struct RexxPkt
  80. {
  81.     struct Message         VanillaMessage;
  82.  
  83.     struct RexxMsg        *RexxMsg;
  84.     STRPTR            *Array;
  85.     struct RDArgs        *Args;
  86.     struct CommandInfo    *CommandInfo;
  87.     LONG             Results[2];
  88. };
  89.  
  90.     /* A special function key pointer. */
  91.  
  92. typedef STRPTR (*  COMMAND)(struct RexxPkt *);
  93.  
  94.     /* Argument inclusion bits. */
  95.  
  96. #define INCLUDE_00 (1 <<  0)
  97. #define INCLUDE_01 (1 <<  1)
  98. #define INCLUDE_02 (1 <<  2)
  99. #define INCLUDE_03 (1 <<  3)
  100. #define INCLUDE_04 (1 <<  4)
  101. #define INCLUDE_05 (1 <<  5)
  102. #define INCLUDE_06 (1 <<  6)
  103. #define INCLUDE_07 (1 <<  7)
  104. #define INCLUDE_08 (1 <<  8)
  105. #define INCLUDE_09 (1 <<  9)
  106. #define INCLUDE_10 (1 << 10)
  107. #define INCLUDE_11 (1 << 11)
  108.  
  109.     /* Rexx command information. */
  110.  
  111. struct CommandInfo
  112. {
  113.     WORD    Async;
  114.     BYTE    Tool;
  115.     BYTE    Console;
  116.     COMMAND    Routine;
  117.     STRPTR    Name,
  118.         Arguments;
  119. };
  120.  
  121.     /* termARexx.c */
  122.  
  123. BYTE __regargs            IsNumeric(STRPTR String);
  124. STRPTR __regargs        CreateResult(STRPTR ResultString,LONG *Results);
  125. STRPTR __regargs        CreateResultLen(STRPTR ResultString,LONG *Results,LONG Len);
  126. BYTE __stdargs            CreateVarArgs(STRPTR Value,struct RexxPkt *Packet,STRPTR Stem,...);
  127. STRPTR __regargs        CreateVar(STRPTR Value,struct RexxPkt *Packet,STRPTR Name);
  128. STRPTR __regargs        CreateMatchBuffer(STRPTR Pattern);
  129. BYTE __regargs            MatchBuffer(STRPTR Buffer,STRPTR Name);
  130. VOID __regargs            DeleteMatchBuffer(STRPTR Buffer);
  131. WORD __regargs            ToMode(STRPTR Name);
  132. WORD __regargs            ToList(STRPTR Name);
  133. WORD __regargs            ToConfig(STRPTR Name);
  134. WORD __regargs            ToRequester(STRPTR Name);
  135. WORD __regargs            ToWindow(STRPTR Name);
  136. VOID __regargs            RexxPktCleanup(struct RexxPkt *Packet,STRPTR Result);
  137. VOID __saveds            RexxServer(VOID);
  138. BYTE                HandleRexx(VOID);
  139.  
  140.     /* termARexxAttributes.c */
  141.  
  142. STRPTR                RexxGetAttr(struct RexxPkt *Pkt);
  143. STRPTR                RexxSetAttr(struct RexxPkt *Pkt);
  144.  
  145.     /* termARexxCommands.c */
  146.  
  147. STRPTR                RexxActivate(struct RexxPkt *Pkt);
  148. STRPTR                RexxAdd(struct RexxPkt *Pkt);
  149. STRPTR                RexxBaud(struct RexxPkt *Pkt);
  150. STRPTR                RexxBeepScreen(struct RexxPkt *Pkt);
  151. STRPTR                RexxCallMenu(struct RexxPkt *Pkt);
  152. STRPTR                RexxCapture(struct RexxPkt *Pkt);
  153. STRPTR                RexxClear(struct RexxPkt *Pkt);
  154. STRPTR                RexxClearScreen(struct RexxPkt *Pkt);
  155. STRPTR                RexxClose(struct RexxPkt *Pkt);
  156. STRPTR                RexxCloseDevice(struct RexxPkt *Pkt);
  157. STRPTR                RexxCloseRequester(struct RexxPkt *Pkt);
  158. STRPTR                RexxDeactivate(struct RexxPkt *Pkt);
  159. STRPTR                RexxDial(struct RexxPkt *Pkt);
  160. STRPTR                RexxDelay(struct RexxPkt *Pkt);
  161. STRPTR                RexxDuplex(struct RexxPkt *Pkt);
  162. STRPTR                RexxFault(struct RexxPkt *Pkt);
  163. STRPTR                RexxGetClip(struct RexxPkt *Pkt);
  164. STRPTR                RexxGoOnline(struct RexxPkt *Pkt);
  165. STRPTR                RexxHangup(struct RexxPkt *Pkt);
  166. STRPTR                RexxHelp(struct RexxPkt *Pkt);
  167. STRPTR                RexxOpen(struct RexxPkt *Pkt);
  168. STRPTR                RexxOpenDevice(struct RexxPkt *Pkt);
  169. STRPTR                RexxOpenRequester(struct RexxPkt *Pkt);
  170. STRPTR                RexxParity(struct RexxPkt *Pkt);
  171. STRPTR                RexxPasteClip(struct RexxPkt *Pkt);
  172. STRPTR                RexxPrint(struct RexxPkt *Pkt);
  173. STRPTR                RexxProcessIO(struct RexxPkt *Pkt);
  174. STRPTR                RexxProtocol(struct RexxPkt *Pkt);
  175. STRPTR                RexxPutClip(struct RexxPkt *Pkt);
  176. STRPTR                RexxQuit(struct RexxPkt *Pkt);
  177. STRPTR                RexxRead(struct RexxPkt *Pkt);
  178. STRPTR                RexxReceiveFile(struct RexxPkt *Pkt);
  179. STRPTR                RexxRedial(struct RexxPkt *Pkt);
  180. STRPTR                RexxRemove(struct RexxPkt *Pkt);
  181. STRPTR                RexxRequestFile(struct RexxPkt *Pkt);
  182. STRPTR                RexxRequestNotify(struct RexxPkt *Pkt);
  183. STRPTR                RexxRequestNumber(struct RexxPkt *Pkt);
  184. STRPTR                RexxRequestResponse(struct RexxPkt *Pkt);
  185. STRPTR                RexxRequestString(struct RexxPkt *Pkt);
  186. STRPTR                RexxResetScreen(struct RexxPkt *Pkt);
  187. STRPTR                RexxResetStyles(struct RexxPkt *Pkt);
  188. STRPTR                RexxResetText(struct RexxPkt *Pkt);
  189. STRPTR                RexxResetTimer(struct RexxPkt *Pkt);
  190. STRPTR                RexxSaveAs(struct RexxPkt *Pkt);
  191. STRPTR                RexxSave(struct RexxPkt *Pkt);
  192. STRPTR                RexxSelect(struct RexxPkt *Pkt);
  193. STRPTR                RexxSend(struct RexxPkt *Pkt);
  194. STRPTR                RexxSendBreak(struct RexxPkt *Pkt);
  195. STRPTR                RexxSendFile(struct RexxPkt *Pkt);
  196. STRPTR                RexxSpeak(struct RexxPkt *Pkt);
  197. STRPTR                RexxStopBits(struct RexxPkt *Pkt);
  198. STRPTR                RexxTextBuffer(struct RexxPkt *Pkt);
  199. STRPTR                RexxTimeout(struct RexxPkt *Pkt);
  200. STRPTR                RexxTrap(struct RexxPkt *Pkt);
  201. STRPTR                RexxWait(struct RexxPkt *Pkt);
  202. STRPTR                RexxWindow(struct RexxPkt *Pkt);
  203. STRPTR                RexxRX(struct RexxPkt *Pkt);
  204. STRPTR                RexxExecTool(struct RexxPkt *Pkt);
  205.  
  206.     /* termARexxData.c */
  207.  
  208. extern struct AttributeEntry __far     AttributeTable[];
  209. extern LONG                 AttributeTableSize;
  210.  
  211. extern UWORD                 InclusionTable[];
  212. extern struct ExclusionInfo        *ExclusionTable[];
  213.  
  214. extern struct CommandInfo __far         CommandTable[];
  215. extern LONG                 CommandTableSize;
  216.  
  217. extern struct MsgPort            *RexxPort;
  218. extern LONG                 LastRexxError;
  219. extern LONG                 RexxTimeoutVal;
  220. extern BYTE                 UpdateRequired,
  221.                      TransferUpdateRequired;
  222. extern LONG                 RexxLaunchCount;
  223. extern struct SignalSemaphore         RexxLaunchSemaphore;
  224.